package com.woniuxy.pxxt.utils;

import com.woniuxy.pxxt.entity.User;
import com.woniuxy.pxxt.shiro.MyJsonWebToken;
import com.woniuxy.pxxt.shiro.MyRealm;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO:
 * <P> Date: 2022/3/14:21:58
 * <P> Description:
 */
@RestController
@RequestMapping("/menu")
public class TokenUtil {

    /**
     * <P>Author ideaAdmin
     * <P>TODO:从当前登陆用户的获得校长 存放的是user信息
     * <P>Date 21:46 2022/3/14
     * <P>* @param request
     * <P>* @return java.lang.String
     **/
    public static User getUser() {
        return (User) SecurityUtils.getSubject().getPrincipal();
    }

}
